<!DOCTYPE html>
<html>
<head>
    <title>学生管理系统</title>
    <style>
        /* 简单的样式 */
        body { font-family: Arial, sans-serif; }
        table, th, td { border: 1px solid black; border-collapse: collapse; padding: 5px; }
    </style>
</head>
<body>
<h2>学生信息列表</h2>
<table id="studentTable">
    <thead>
    <tr><th>ID</th><th>姓名</th><th>年龄</th></tr>
    </thead>
    <tbody>
    <!-- 数据将通过JavaScript插入 -->
    </tbody>
</table>
<script>
    // 使用Fetch API获取学生数据并填充表格
    fetch('/api/students')
        .then(response => response.json())
        .then(data => { const tableBody = document.querySelector('#studentTable tbody');
            data.forEach(student => {
                const row = `<tr><td>${student.id}</td><td>${student.name}</td><td>${student.age}</td></tr>`;
                tableBody.innerHTML += row;
            });
        }) .catch(error => console.error('Error:', error));
</script>
</body>
</html>